﻿

using System;
using System.ServiceModel;
using System.Runtime.Serialization;

using WCFContract.Contract.TeacherContract;

namespace WCFService
{

    public class TeacherService : ITeacher
    {

        public string GetTeacherNameWithId(Guid id)
        {
            return GetTeacherDC(id).Name;
        }

        public WCFModel.DataContract.Teacher GetTeacherWithId(Guid id)
        {
            return GetTeacherDC(id);
        }

        public WCFModel.MessageContract.Teacher GetTeacher(WCFModel.MessageContract.Teacher obj)
        {
            return GetTeacherMC(obj.TeacherId);
        }
        private WCFModel.DataContract.Teacher GetTeacherDC(Guid id)
        {
            return new WCFModel.DataContract.Teacher() {  TeacherId = id, Name = "luoliang" + "_" + id, Age = 100  };
        }
        private WCFModel.MessageContract.Teacher GetTeacherMC(Guid id)
        {
            return new WCFModel.MessageContract.Teacher() { SessionId = id, AppId = id, TeacherId = id, UserId = id, Name = "luoliang" + "_" + id, Age = 100 };
        }
    }

}
